package com.sunwayworld.basemodule.rm.equipment.equiptfileacq.resource.impl;

import com.sunwayworld.basemodule.rm.equipment.equiptfileacq.resource.LimsEquiptFileAcqConfigResource;
import com.sunwayworld.basemodule.rm.equipment.equiptfileacq.service.LimsEquiptFileAcqConfigService;
import com.sunwayworld.framework.log.annotation.Log;
import com.sunwayworld.framework.log.annotation.LogModule;
import com.sunwayworld.framework.log.annotation.LogType;
import com.sunwayworld.framework.restful.data.RestJsonWrapperBean;
import com.sunwayworld.framework.spring.annotation.GikamBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@LogModule("设备文件采集配置")
@RestController
@GikamBean
public class LimsEquiptFileAcqConfigResourceImpl implements LimsEquiptFileAcqConfigResource {

    @Autowired
    private LimsEquiptFileAcqConfigService limsEquiptFileAcqConfigService;

    @Override
    public LimsEquiptFileAcqConfigService getService() {
        return limsEquiptFileAcqConfigService;
    }

    @Log(value = "新增设备文件采集配置", type = LogType.INSERT)
    @Override
    @RequestMapping(method = RequestMethod.POST)
    public Long insert(RestJsonWrapperBean wrapper) {
        return getService().insert(wrapper);
    }

    @Log(value = "设备连接测试", type = LogType.SELECT)
    @Override
    @RequestMapping(value = "/connect", method = RequestMethod.POST)
    public boolean connect(RestJsonWrapperBean wrapper) {
        return getService().connect(wrapper);
    }

    @Log(value = "设备采集任务添加", type = LogType.INSERT)
    @Override
    @RequestMapping(value = "/acqFiles", method = RequestMethod.POST)
    public void acqFiles(RestJsonWrapperBean wrapper) {
        getService().acqFilesSchedule(wrapper);
    }
}
